#include "gtest/gtest.h"
// #include <mockcpp/mokc.h>
// #include <mockcpp/mockcpp.hpp>

#include <vector>
#include <iostream>
#include <stdlib.h>

#include "stream_pub.h"
#include "topoinfo_struct.h"
#include "log.h"
#include "checker_def.h"
#include "topo_meta.h"
#include "testcase_utils.h"
#include "checker.h"
#include "dispatcher.h"
using namespace checker;
using namespace hccl;

using namespace std;

extern void log_level_set_stub(s32 log_level);

s32 ahc_log_level = 3;

std::vector<u64> ahcDataCount = {
    800,
    //8192,//8K
    //1048576,//1M
    //8388608,//8M
    //134217728,//128M
    //1073741824,//1G
};

std::vector<string> ahcAlgName = {
    "level0:null;level1:AHC_BROKE",
    "level0:ring;level1:AHC",
    "level0:NA;level1:AHC",
    //"level0:NA;level1:AHC_BROKE",
};

std::vector<string> ahcAllReduce910bAlgName = {
    "AllReduceMeshExecutor",
    //"AllReduceRingExecutor",
};

std::vector<string> ahcAllReduce91093AlgName = {
    //"AllReduceFastDoubleRingFor91093Executor",
    //"AlignedAllReduceDoubleRingFor91093Executor",
    "AllReduceRingFor91093Executor",
};

std::vector<string> ahcReduceScatter910bAlgName = {
    "ReduceScatterMeshExecutor",
    //"ReduceScatterRingExecutor",
};

std::vector<string> ahcReduceScatter91093AlgName = {
    "ReduceScatterFastDoubleRingFor91093Executor",
    //"AlignedReduceScatterDoubleRingFor91093Executor",
    //"ReduceScatterRingFor91093Executor",
};

std::vector<string> ahcAllGather910bAlgName = {
    "AllGatherMeshExecutor",
    //"AllGatherRingExecutor",
};

std::vector<string> ahcAllGatherr91093AlgName = {
    "AllGatherRingFor91093Executor",
    //"AlignedAllGatherDoubleRingFor91093Executor",
};

class AHCTest : public testing::Test {
protected:
    static void SetUpTestCase()
    {
        std::cout << "CheckOpSemanticsTest set up." << std::endl;
    }

    static void TearDownTestCase()
    {
        std::cout << "CheckOpSemanticsTest tear down." << std::endl;
    }

    virtual void SetUp()
    {
        const ::testing::TestInfo* const test_info = ::testing::UnitTest::GetInstance()->current_test_info();
        std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name());
        Checker::SetDumpFileName(caseName);
    }

    virtual void TearDown()
    {
        Checker::SetDumpFileName("analysis_result");
        // GlobalMockObject::verify();
        // 这边每个case执行完成需要清理所有的环境变量，如果有新增的环境变量，需要在这个函数中进行清理
        ClearHcclEnv();
    }
};

static inline void CheckAlgTest(CheckerOpParam  &checkerOpParam, TopoMeta &topoMeta,
    u64 ahcDataCount, string hcclAlgo, string ahcTestCaseName)
{
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
#if 0
    if (ret == HcclResult::HCCL_SUCCESS) {
        std::cout << ahcTestCaseName
            << " excutor name:" << checkerOpParam.algName << " op type:" <<checkerOpParam.tag
            << " alg name:" << hcclAlgo << " data cnt:" << ahcDataCount
            << " run successed" << std::endl;
    } else {
        std::cout << ahcTestCaseName
            << " excutor name:" << checkerOpParam.algName << " op type:" <<checkerOpParam.tag
            << " alg name:" << hcclAlgo << " data cnt:" << ahcDataCount
            << " run failed" << std::endl;
    }
#endif
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

static inline void Levle0_comm_all_op_Test(CheckerOpParam  &checkerOpParam, TopoMeta &topoMeta,
    string testAhcAlgName, string testAhcCaseName, string opName, bool setExcutor = true)
{
    for (int m = 0; m < ahcDataCount.size(); m++) {
        checkerOpParam.DataDes.count = ahcDataCount[m];
        setenv("HCCL_ALGO", testAhcAlgName.c_str(), 1);
        if ( opName =="AllReduce" ) {
            //test allreduce
            if (setExcutor) {
                checkerOpParam.algName = "AllReduceComm";
            }
            checkerOpParam.opType = CheckerOpType::ALLREDUCE;
            checkerOpParam.tag = "AllReduce";
            CheckAlgTest(checkerOpParam, topoMeta, ahcDataCount[m], testAhcAlgName, testAhcCaseName);
        } else if ( opName =="ReduceScatter" ) {
            //test reduce scatter
            if (setExcutor) {
                checkerOpParam.algName = "ReduceScatterComm";
            }
            checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
            checkerOpParam.tag = "ReduceScatter";
            CheckAlgTest(checkerOpParam, topoMeta, ahcDataCount[m], testAhcAlgName, testAhcCaseName);
        } else if ( opName =="AllGather" ) {
            //test all gather
            if (setExcutor) {
                checkerOpParam.algName = "AllGatherComm";
            }
            checkerOpParam.opType = CheckerOpType::ALLGATHER;
            checkerOpParam.tag = "AllGather";
            CheckAlgTest(checkerOpParam, topoMeta, ahcDataCount[m], testAhcAlgName, testAhcCaseName);
        }
    }
}

static inline void Levle1_91093_all_op_Test(CheckerOpParam  &checkerOpParam, TopoMeta &topoMeta,
    string testAhcAlgName, string testAhcCaseName, string opName, bool setExcutor = true)
{
    for (int m = 0; m < ahcDataCount.size(); m++) {
        checkerOpParam.DataDes.count = ahcDataCount[m];
        setenv("HCCL_ALGO", testAhcAlgName.c_str(), 1);

        if ( opName =="AllReduce" ) {
            for (int i = 0; i < ahcAllReduce91093AlgName.size(); i++) {
                if (setExcutor) {
                    checkerOpParam.algName = ahcAllReduce91093AlgName[i];
                }
                checkerOpParam.opType = CheckerOpType::ALLREDUCE;
                checkerOpParam.tag = "AllReduce";
                CheckAlgTest(checkerOpParam, topoMeta, ahcDataCount[m], testAhcAlgName, testAhcCaseName);
            }
        } else if ( opName =="ReduceScatter" ) {
            for (int i = 0; i < ahcReduceScatter91093AlgName.size(); i++) {
                if (setExcutor) {
                    checkerOpParam.algName = ahcReduceScatter91093AlgName[i];
                }
                checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
                checkerOpParam.tag = "ReduceScatter";
                CheckAlgTest(checkerOpParam, topoMeta, ahcDataCount[m], testAhcAlgName, testAhcCaseName);
            }
        } else if ( opName =="AllGather" ) {
            for (int i = 0; i < ahcAllGatherr91093AlgName.size(); i++) {
                if (setExcutor) {
                    checkerOpParam.algName = ahcAllGatherr91093AlgName[i];
                }
                checkerOpParam.opType = CheckerOpType::ALLGATHER;
                checkerOpParam.tag = "AllGather";
                CheckAlgTest(checkerOpParam, topoMeta, ahcDataCount[m], testAhcAlgName, testAhcCaseName);
            }
        }
    }
}

//all reduce case
TEST_F(AHCTest, allreduce_910c_case4)
{
    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);

    setenv("HCCL_ALGO", "level0:ring;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "AllReduceRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, allreduce_910c_case5)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);


    setenv("HCCL_ALGO", "level0:ring;level1:AHC_BROKE", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "AllReduceRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, allreduce_910c_case6)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "AllReduceRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, allreduce_910c_case7) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, allreduce_910c_case8) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC_BROKE", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, allreduce_910c_case9) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3}}, {{0, 1, 2, 3, 4, 5, 6, 7}}};


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, allreduce_910c_case10) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2}}, {{0, 1, 2, 3, 4, 5, 6, 7}}};


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLREDUCE;
    checkerOpParam.tag = "AllReduce";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

// reduce scatter case
TEST_F(AHCTest, ReduceScatter_910c_case4)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);


    setenv("HCCL_ALGO", "level0:ring;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
    checkerOpParam.tag = "ReduceScatter";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "ReduceScatterFastDoubleRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, ReduceScatter_910c_case5)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);


    setenv("HCCL_ALGO", "level0:ring;level1:AHC_BROKE", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
    checkerOpParam.tag = "ReduceScatter";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "ReduceScatterRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, ReduceScatter_910c_case6)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
    checkerOpParam.tag = "ReduceScatter";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "ReduceScatterRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, ReduceScatter_910c_case7) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
    checkerOpParam.tag = "ReduceScatter";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, ReduceScatter_910c_case8) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC_BROKE", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::REDUCE_SCATTER;
    checkerOpParam.tag = "ReduceScatter";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

//all gather
TEST_F(AHCTest, AllGather_910c_case4)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);


    setenv("HCCL_ALGO", "level0:ring;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLGATHER;
    checkerOpParam.tag = "AllGather";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "AlignedAllGatherDoubleRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, AllGather_910c_case5)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);


    setenv("HCCL_ALGO", "level0:ring;level1:AHC_BROKE", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLGATHER;
    checkerOpParam.tag = "AllGather";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    checkerOpParam.algName = "AllGatherRingFor91093Executor";
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, AllGather_910c_case7) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLGATHER;
    checkerOpParam.tag = "AllGather";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

TEST_F(AHCTest, AllGather_910c_case8) //default case
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);


    setenv("HCCL_ALGO", "level0:NA;level1:AHC_BROKE", 1);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opType = CheckerOpType::ALLGATHER;
    checkerOpParam.tag = "AllGather";
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.count = 800;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;
    Checker checker;
    HcclResult ret;
    ret = checker.Check(checkerOpParam, topoMeta);
    EXPECT_EQ(ret, HcclResult::HCCL_SUCCESS);
}

#if 0
TEST_F(AHCTest, allreduce_910b_comm_two_server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 2, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910B;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:null;level1:AHC");
    string testAhcCaseName = string("allreduce_910b_comm_two_server_test");

    Levle0_comm_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, allreduce_910_93_single_server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:ring;level1:AHC");
    string testAhcCaseName = string("allreduce_910_93_single_server_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_single_server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:ring;level1:AHC");
    string testAhcCaseName = string("reduce_scatter_910_93_single_server_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_single_server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 1, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:ring;level1:AHC");
    string testAhcCaseName = string("all_gather_910_93_single_server_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

TEST_F(AHCTest, allreduce_910_93_2spod_2server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("allreduce_910_93_2spod_2server_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_2server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_2server_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_2server_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("all_gather_910_93_2spod_2server_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

TEST_F(AHCTest, allreduce_910_93_2spod_2server_broke_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("allreduce_910_93_2spod_2server_broke_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_2server_broke_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_2server_broke_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_2server_broke_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("all_gather_910_93_2spod_2server_broke_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

TEST_F(AHCTest, allreduce_910_93_2spod_2server_default_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("allreduce_910_93_2spod_2server_default_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ), false);
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_2server_default_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_2server_default_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ), false);
}

TEST_F(AHCTest, all_gather_910_93_2spod_2server_default_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta;
    gen.GenTopoMeta(topoMeta, 2, 1, 8);

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("all_gather_910_93_2spod_2server_default_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ), false);
}

TEST_F(AHCTest, allreduce_910_93_2spod_rank_diff_5_8_null_ahc_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4}}, {{0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:null;level1:AHC");
    string testAhcCaseName = string("allreduce_910_93_2spod_rank_diff_5_8_null_ahc_test");

    Levle0_comm_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_rank_diff_5_8_null_ahc_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4}}, {{0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:null;level1:AHC");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_rank_diff_5_8_null_ahc_test");

    Levle0_comm_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_rank_diff_5_8_null_ahc_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4}}, {{0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:null;level1:AHC");
    string testAhcCaseName = string("all_gather_910_93_2spod_rank_diff_5_8_null_ahc_test");

    Levle0_comm_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

#endif

#if 0
TEST_F(AHCTest, allreduce_910_93_2spod_server_diff_2_3_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("allreduce_910_93_2spod_server_diff_2_3_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_server_diff_2_3_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_server_diff_2_3_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_server_diff_2_3_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("all_gather_910_93_2spod_server_diff_2_3_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

TEST_F(AHCTest, allreduce_910_93_2spod_server_diff_2_4_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("allreduce_910_93_2spod_server_diff_2_4_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_server_diff_2_4_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_server_diff_2_4_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_server_diff_2_4_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("all_gather_910_93_2spod_server_diff_2_4_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_server_diff_2_4_broke_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC_BROKE");
    string testAhcCaseName = string("all_gather_910_93_2spod_server_diff_2_4_broke_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}

TEST_F(AHCTest, allreduce_910_93_2spod_server_diff_4_6_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("allreduce_910_93_2spod_server_diff_4_6_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllReduce" ));
}

TEST_F(AHCTest, reduce_scatter_910_93_2spod_server_diff_4_6_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("reduce_scatter_910_93_2spod_server_diff_4_6_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "ReduceScatter" ));
}

TEST_F(AHCTest, all_gather_910_93_2spod_server_diff_4_6_test)
{

    RankTable_For_LLT gen;
    TopoMeta topoMeta {{{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} },
        {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7} , {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 2, 3, 4, 5, 6, 7}}};

    CheckerOpParam  checkerOpParam;
    checkerOpParam.opMode = CheckerOpMode::OPBASE;
    checkerOpParam.reduceType = CheckerReduceOp::REDUCE_SUM;
    checkerOpParam.devtype = CheckerDevType::DEV_TYPE_910_93;
    checkerOpParam.DataDes.dataType = CheckerDataType::DATA_TYPE_INT32;

    string testAhcAlgName = string("level0:NA;level1:AHC");
    string testAhcCaseName = string("all_gather_910_93_2spod_server_diff_4_6_test");

    Levle1_91093_all_op_Test(checkerOpParam, topoMeta, testAhcAlgName, testAhcCaseName, string( "AllGather" ));
}
#endif